import React from 'react';
import { Row, Col, Typography, Space, Button } from 'antd';
import { ShoppingCartOutlined, TeamOutlined } from '@ant-design/icons';
import styled from 'styled-components';
import {history} from '@umijs/max';
const { Title, Text } = Typography;

const WelcomeContainer = styled.div`
  margin-bottom: 24px;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
`;

const WelcomeSection: React.FC = () => {
  return (
    <WelcomeContainer>
      <Row align="middle" justify="space-between">
        <Col>
          <Title level={3} style={{ margin: 0 }}>欢迎回来，管理员</Title>
          <Text type="secondary" style={{ fontSize: '14px' }}>
            今天是 {new Date().toLocaleDateString('zh-CN', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}
          </Text>
        </Col>
        <Col>
          <Space>
            <Button type="primary" icon={<ShoppingCartOutlined />}
                    onClick={() => {
                      history.push('/order/order-edit');
                    }}
            >新建订单</Button>
            <Button icon={<TeamOutlined />} onClick={() => {
              history.push('/organization/customer-manager');
            }}>添加客户</Button>
          </Space>
        </Col>
      </Row>
    </WelcomeContainer>
  );
};

export default WelcomeSection;
